home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.2 KB | 218 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: PhotoShop.vu
- #
- # Contains: Quick look test script for Photoshop version 2.0.1
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/28/93 KTA Added returnVal for ModifyDocument hook.
- # <1.0.3> 7/30/93 KTA Commented out DoText() since there are no font menus.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up tools and fonts for Photoshop. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kLinePaletteNum := 0;
- global kPatternPaletteNum := 0;
- global kColorPaletteNum := 2;
-
- global gLineWeights := {};# This is used for menuItems
-
- global gWindowInset := {0,20,20,20}; # Window inset
- global gScreenInset := {62,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gTextStr;
- global gDocumentWindow := 0; # only used in Freehand at this point;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {5, 36, 55, 256}, # Location of palette absolute Coordinates
- kPalDocWind, # Palette type
- {2,10}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {25,22} # Offset between tools {h,v}
- } #### End Palette #1
- };
-
-
- ### PhotoShop {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global SelectionTool := { 1, 1, "Selection", kDrag, 0, {0}};
- global RndSelectionTool := { 2, 1, "RndSelection", kDrag, 0, {0}};
- global LassoTool := { 3, 1, "Lasso", kMultiDrag, 0, {0}};
- global WandTool := { 4, 1, "Wand", kClick, 0, {0}};
-
- global CropTool := { 5, 1, "Crop", kDrag, 1, {0}};
- global PenTool := { 6, 1, "Pen", kMultiClick,0, {0}};
- global HandTool := { 7, 1, "Hand", kMultiDrag, 0, {0}};
- global ZoomTool := { 8, 1, "Zoom", kClick, 0, {0}};
-
- global BucketTool := { 9, 1, "Bucket", kClick, 0, {0}};
- global BlendTool := { 10, 1, "Blend", kDrag, 0, {0}};
- global LineTool := { 11, 1, "Line", kDrag, 0, {0}};
- global ColorDropper := { 12, 1, "ColorDropper", kMultiClick,0, {0}};
-
- global EraserTool := { 13, 1, "Eraser", kMultiDrag, 0, {0}};
- global PencilTool := { 14, 1, "Pencil", kMultiDrag, 0, {0}};
- global AirBrush := { 15, 1, "AirBrush", kMultiDrag, 0, {0}};
- global PaintBrush := { 16, 1, "PaintBrush", kMultiDrag, 0, {0}};
-
- global RubberStamp := { 17, 1, "RubberStamp", kDragClick, 0, {0}};
- global SmudgeTool := { 18, 1, "Smudge", kDrag, 0, {0}};
- global BlurTool := { 19, 1, "Blur", kDrag, 0, {0}};
- global CharTool := { 20, 1, "Character", kClick, 0, {0}};
-
-
- # global Tool list
- global gToolList:={ SelectionTool,
- RndSelectionTool,
- LassoTool,
- #WandTool,
-
- #CropTool,
- #PenTool,
- HandTool,
- ZoomTool,
-
- BucketTool,
- BlendTool,
- LineTool,
- ColorDropper,
-
- EraserTool,
- PencilTool,
- AirBrush,
- PaintBrush,
-
- RubberStamp,
- SmudgeTool,
- BlurTool
- #CharTool
- };
-
- ### Set DoWindows to skip scrolling, scroll bars not recongnized
- global gDoWindowList:= {1,0,1,1};
-
- end; # InitAppGlobals
-
- #########################################################################
- # PhotoShopModifyDocument()
- #========================================================================
- # Author: ML
- # Description: Modify PhotoShop Document
- # Parameters: None
- # Returns: Nothing
- # Examples: PhotoShopModifyDocument();
- # Assumptions: None
- # Applications: PhotoShop
- #========================================================================
- # History:
- #
- #########################################################################
- task PhotoShopModifyDocument()
- begin
- return(Scrapbook(global kScrapPict));
- end;
-
- #########################################################################
- # PhotoShopScrapText()
- #========================================================================
- # Author: ML
- # Description: Paste text into PhotoShop Document
- # Parameters: None
- # Returns: Nothing
- # Examples: PhotoShopScrapText();
- # Assumptions: None
- # Applications: PhotoShop
- #========================================================================
- # History:
- #
- #########################################################################
- task PhotoShopScrapText()
- begin
- Scrapbook(global kScrapTEXT,,0);
- Draw(global CharTool);
- KeyEq("v"); # Can't use SelectmenuItem because VU thinks it's disabled
- SpecialKey(EnterKey, "EnterKey");
- wait(1);
- if (DialogCheck('',1))
- SpecialKey(EnterKey, "EnterKey");
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script PhotoShop (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- Global gApptitle := "Adobe PhotoShop"; # Title of app you will be running
- global gAppVersion := '2'; # version of app you will be running
- SuiteStart('PhotoShop.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gFileName := "@!@-{gBuildVers}-PhotoShop"; # This is used in NameOK when saving files
- global gModifyDocument:= task PhotoShopModifyDocument; # define app specific task
- global gCustomScrapText:= task PhotoShopScrapText; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(,,,"OK",1,1,1); # No Default window
- #DoText(0); # No Font Menus in Photoshop #commented out KA - 7/30/93
- DoWindow(); # There are no recognizable scrollbars in Photoshop
- DoCloseApp(1);
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: Fonts and Styles are contained within dialog boxes, so no DoText");
- LogStr("NOTE: VU does not recognizable scrollbars, so scrolling not tested.");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script PhotoShop
-
- ### What's Needed
- # 1) Insure that Palette is up and in the left corner or the screen
- # 2) Insure that Drawing window does not cover any portion of the palette
- # 3) Insure that Pointer tool is selected after DoText before DoWindow
-